# Contributor: Alexey Yerin <yyp@disroot.org>
# Maintainer: Alexey Yerin <yyp@disroot.org>
pkgname=tut
pkgver=2.0.1
pkgrel=13
pkgdesc="TUI for Mastodon"
url="https://github.com/RasmusLindroth/tut"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/RasmusLindroth/tut/archive/refs/tags/$pkgver.tar.gz
"
options="net !check" # no tests

export GOFLAGS="$GOFLAGS -modcacherw -trimpath"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -o tut
}

package() {
	install -D -m755 tut "$pkgdir"/usr/bin/tut

	install -D -m644 -t "$pkgdir"/usr/share/man/man1/ docs/man/tut.1
	install -D -m644 -t "$pkgdir"/usr/share/man/man5/ docs/man/tut.5
	install -D -m644 -t "$pkgdir"/usr/share/man/man7/ docs/man/tut.7
	install -D -m644 -t "$pkgdir"/usr/share/doc/"$pkgname"/examples/themes/ \
		config/themes/*.toml
	install -D -m644 config.example.toml \
		"$pkgdir"/usr/share/doc/"$pkgname"/examples/config.toml
}

sha512sums="
ad49ea3377de21a067f56e0910ff5c43d12528b3b68722d3863554c5db469b41f690880a8227c73df3da3133d39d2bb186461c2b9db1f2ee23f6fdc3d6d5a822  tut-2.0.1.tar.gz
"
